#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <deque>
#include <functional>
#include <climits>

#define quickio ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define endl "\n"

using namespace std;
typedef long long ll;

void solve()
{
	int n, k;
	cin >> n >> k;
	string s;
	cin >> s;

	sort(s.begin(), s.end());
	
	int ans = 0;
	do
	{
		for (int i = 0; i < n - k; i++)
		{
			int l = i, r = i + k - 1;
			int flag = 0;
			while (l < r)
			{
				if (s[l] != s[r])
				{
					flag = 1;
					break;
				}
				l++;
				r--;
			}

			if (flag)
				ans++;
		}
	} while (next_permutation(s.begin(), s.end()));

	cout << ans << endl;
}

int main()
{
	solve();
	return 0;
}